package com.ruoyi.finance.rules.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.finance.rules.service.RulescommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/rules/common")
public class RulescommonController {

    @Autowired
    private RulescommonService rulescommonService;

    /**
     * 查询代码表
     */
    @PostMapping("/dmcTable")
    public AjaxResult dmcTable(String code){
        List<Map<String, String>> list = rulescommonService.dmcTable(code);
        return AjaxResult.success(list);
    }

    /**
     * 查询VIP规则
     */
    @PostMapping("/listSzVipRule")
    public AjaxResult listSzVipRule(){
        List<Map<Long, String>> list = rulescommonService.listSzVipRule();
        return AjaxResult.success(list);
    }

    /**
     * 查询其它规则
     * @return
     */
    @PostMapping("/getOtherRule")
    public AjaxResult getOtherRule(){
        Map<String, Object> data = rulescommonService.getOtherRule();
        return AjaxResult.success(data);
    }

    /**
     * 查询用户简单信息
     */
    @PostMapping("/listSzUserSimple")
    public AjaxResult listSzUserSimple(String userId){
        List<Map<String, String>> data = rulescommonService.listSzUserSimple(userId);
        return AjaxResult.success(data);
    }

}
